import uvicorn as uvicorn
from fastapi import FastAPI
from test_lib import People
app= FastAPI()

@app.post("/people")
def insert(people: People):
    age = people.age
    msg = f"名字:{people.name},年岭:{age}"
    return {"success": True, "msg": msg}
if __name__ == "__main__":
    uvicorn.run(app=app, host="http://192.168.2.100", port=5000)  # uvicorn test:app --reload 时，此ip与port不起作用，实际为 http://127.0.0.1:8000 

